{% extends "layouts/layout.html" %}
{% block title %}
Admin
{% endblock %}
{% block content %}
<h3>Administration</h3>
<hr />
<h5>Activated users</h5>
<table class="table table-striped">
{% for user in activated_users %}
<tr>
  <td>
	<div>
      <a href="/admin/user_activation?user_id={{ user.user_id }}&xsrf_token={{xsrf_token}}">
        <button class="btn btn-primary" type="submit" value="Deactivate">Deactivate</button> 
      </a>
        <b>Nickname:</b> {{ user.nickname }} <b>Name:</b> {% if user.private %} &lt<i>Private</i>&gt {% else %} {{ user.first_name }} {{ user.last_name }} {% endif %} <b>User ID:</b> {{ user.user_id }} <b>Active:</b> {{ user.is_active }}
    </div>
  </td>
</tr>
{% endfor %}
</table>
<h5>Deactivated users</h5>
<table class="table table-striped">
{% for user in deactivated_users %}
<tr>
  <td>
    <div>
      <a href="/admin/user_activation?user_id={{ user.user_id }}&xsrf_token={{xsrf_token}}">
        <button class="btn btn-primary" type="submit" value="Reactivate">Reactivate</button> 
      </a>
        <b>Nickname:</b> {{ user.nickname }} <b>Name:</b> {% if user.private %} &lt<i>Private</i>&gt {% else %} {{ user.first_name }} {{ user.last_name }} {% endif %} <b>User ID:</b> {{ user.user_id }} <b>Active:</b> {{ user.is_active }}
    </div>
  </td>
</tr>
{% endfor %}
</table>
<p>
  <a class="btn" href="/admin/modify">Go to 'Create Admins'</a> 
  <a class="btn" href="/admin/partners">Go to 'Trusted Partners'</a>
  {% if is_test_data_loaded %}
    <a class="btn" href="/admin/load_test_data?xsrf_token={{xsrf_token}}">Delete test data</a>
  {% else %}
    <a class="btn" href="/admin/load_test_data?xsrf_token={{xsrf_token}}">Load test data</a>
  {% endif %}
</p>
{% endblock %}
